package com.aloaproject.ciquta;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Daniele Demichelis
 */
public class CommonProjection implements Projection {

    private class Status{

        private List objects = new ArrayList();

        public Status() {
        }

        private void add(Object object) {
            this.objects.add(object);
        }

        private List getResult() {
            return objects;
        }

    }

    public List getResult(Object projectionStatus) {
        Status status = (Status)projectionStatus;
        return status.getResult();
    }

    public Object getStartStatus() {
        return new Status();
    }

    public Object project(Object projectionStatus, Object object) {
        Status status = (Status)projectionStatus;
        status.add(object);
        return status;
    }

}
